<style scoped>
  .layout{
    border: 1px solid #d7dde4;
    background: #f5f7f9;
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    height: 100%;
  }
  .layout-logo{
    /* width: 200px; */
    line-height: 40px;
    height: 40px;
    border-radius: 3px;
    float: left;
    position: relative;
    top: 15px;
    left: 20px;
    font-weight: bold;
    text-align: center;
    color: #8af8d9;
    font-size: 20px;
    align-content: center;
    text-align: center
  }
  .layout-nav{
    width: 590px;
    margin: 0 auto;
    margin-right: 20px;
  }
  .layout-footer-center{
    text-align: center;
  }
  .demo-drawer-footer{
        width: 100%;
        position: absolute;
        bottom: 0;
        left: 0;
        border-top: 1px solid #e8e8e8;
        padding: 10px 16px;
        text-align: right;
        background: #fff;
    }
     .demo-drawer-profile{
        font-size: 14px;
    }
    .demo-drawer-profile .ivu-col{
        margin-bottom: 12px;    
    }
    .diva a{
        color: black;
    }
</style>

<template>
    <div class="layout">
        <Layout>
            <Header>
                <Menu mode="horizontal" theme="dark" active-name="1">
                    <div class="layout-logo">游戏资讯分享论坛</div>
                    <div class="" style="float:right;">
                        <a @click="adminOut('adminOut')" style="color:red">退出登录</a>
                    </div>
                </Menu>
            </Header>

            <Menu mode="horizontal" :theme="theme1" active-key="1">
                
                <div class="diva">
                    <Menu-item key="1"  >
                        <Icon type="ios-paper"></Icon>
                        <a @click="value1 = true">添加游戏公司信息</a>
                    </Menu-item>
                    <Menu-item key="2">
                        <Icon type="ios-people"></Icon>
                        <a @click="findAll()">用户管理</a>  
                    </Menu-item>
                    <Menu-item key="3">
                        <Icon type="ios-paper"></Icon>
                        <a @click="teamFindAll()">游戏公司信息</a>
                    </Menu-item>
                    <Menu-item key="4">
                        <Icon type="ios-paper"></Icon>
                        <a @click="playerClick()">添加游戏信息</a>
                    </Menu-item>
                    <Menu-item key="5">
                        <Icon type="ios-paper"></Icon>
                        <a @click="playersClick()">游戏信息</a>
                    </Menu-item>
                    <Menu-item key="6">
                        <Icon type="ios-paper"></Icon>
                        <a @click="tieziAll()">资讯专区信息</a>
                    </Menu-item>
                    <Menu-item key="7">
                        <Icon type="ios-paper"></Icon>
                        <a @click="weijinciAll()">违禁词信息</a>
                    </Menu-item>
                    <Menu-item key="8">
                        <Icon type="ios-paper"></Icon>
                        <a @click="weijintieAll()">违禁帖信息</a>
                    </Menu-item>
                </div>
            </Menu>

        


             <div style="background:#eee;padding: 20px;width:1000px;margin: 0 auto;margin-top: 20px;">
                <Card :bordered="false">
                    <p slot="title">{{tableDate.username}}</p>
                     <Row>
                        <i-col span="12">邮箱：{{tableDate.email}}</i-col>
                        <i-col span="12">电话：{{tableDate.phone}}</i-col>
                    </Row>
                     <Row>
                        <i-col span="12">性别：{{tableDate.sex}}</i-col>
                        <i-col span="12">地址：{{tableDate.zone}}</i-col>
                    </Row>
                     <Row>
                        <i-col span="12">创建时间：{{tableDate.createDatetime}}</i-col>
                    </Row>
                </Card>
            </div>
              <div style="background:#eee;padding: 20px;width:1000px;margin: 0 auto;margin-top: 20px;">
                <Card :bordered="true">
                    <p slot="title">修改密码</p>
                    <Form ref="formInline" :model="formInline" :rules="ruleInline" inline>
                        <FormItem prop="password">
                            <Input type="password" v-model="formInline.password" placeholder="Password">
                                <Icon type="ios-lock-outline" slot="prepend"></Icon>
                            </Input>
                        </FormItem>
                        <FormItem>
                            <Button type="primary" @click="handleSubmit('formInline')">提交</Button>
                        </FormItem>
                    </Form>
                </Card>
            </div>
           

            <!-- 显示用户 -->
             <div>
                <Drawer :closable="false" width="840" v-model="value4">
                    <p>显示用户</p>
                    
                    <Divider />
                     <content :style="{padding:'0 50px'}">
                        <Card>
                            <Table border :columns="columns2" :data="tableDate"   >
                                <template slot-scope="{ row }" slot="name">
                                    <strong>{{ row.name }}</strong>
                                </template>
                                <template slot-scope="{ row, index }" slot="action">
                                    <Button type="error" size="small" @click="personRemove(row.id)">删除</Button>
                                </template>
                            </Table>
                        </Card>    
                </content>
                </Drawer>
            </div>

            <!-- 添加游戏厂商 -->
            <Drawer :closable="false" width="640" v-model="value1">
                <p>添加游戏厂商</p>
                <Divider />
                <Form :model="TeamFormItem" :label-width="80">
                    <FormItem label="名称">
                        <Input v-model="TeamFormItem.tname" placeholder=""></Input>
                    </FormItem>
                    
                    <FormItem label="成立时间">
                        <Input v-model="TeamFormItem.tshuju" placeholder=""></Input>
                    </FormItem>
                    <FormItem label="总部">
                        <Input v-model="TeamFormItem.tzhanji" placeholder=""></Input>
                    </FormItem>
                        <FormItem label="经典作品">
                        <Input v-model="TeamFormItem.tjiaolian" placeholder=""></Input>
                    </FormItem>
                        <FormItem label="介绍">
                        <Input v-model="TeamFormItem.tshuoming"  placeholder=""></Input>
                    </FormItem>
                    <FormItem>
                        <Button type="primary" @click="TeamSubmit('TeamFormItem')">Submit</Button>
                    </FormItem>
                </Form>
            </Drawer>
            <!-- 展示游戏公司 -->
            <Drawer :closable="false" width="840" v-model="value2">
                <p>游戏公司信息</p>
                <Divider />
                    <content :style="{padding:'0 50px'}">
                    <Card>
                        <Table border :columns="columns3" :data="TeamDate"   >
                            <template slot-scope="{ row }" slot="name">
                                <strong>{{ row.name }}</strong>
                            </template>
                            <template slot-scope="{ row, index }" slot="action">
                                <Button type="error" size="small" @click="teamRemove(row.tid)">删除</Button>
                            </template>
                        </Table>
                    </Card>    
                </content>
            </Drawer>
            <!-- 添加游戏 -->
            <Drawer :closable="false" width="840" v-model="value3">
                <p>添加游戏</p>
                <Divider />
                <Form :model="PlayerFormItem" :label-width="80">
                    <FormItem label="名字">
                        <Input v-model="PlayerFormItem.pname" placeholder=""></Input>
                    </FormItem>
                    <FormItem label="开发商">
                        <Select v-model="PlayerFormItem.ptname">
                            <Option  v-for="(team,index) in TeamDate" :key="index"
                             :value="team.tid">{{team.tname}}</Option>
                        </Select>
                    </FormItem>
                    <FormItem label="国区价格">
                        <Input v-model="PlayerFormItem.pweizhi" placeholder=""></Input>
                    </FormItem>
                        <FormItem label="历史最低价格">
                        <Input v-model="PlayerFormItem.pshengao" placeholder=""></Input>
                    </FormItem>
                        <FormItem label="发布时间">
                        <Input v-model="PlayerFormItem.ptizhong"  placeholder=""></Input>
                    </FormItem>
                     </FormItem>
                        <FormItem label="游戏类型">
                        <Input v-model="PlayerFormItem.pjingyan"  placeholder=""></Input>
                    </FormItem>
                     </FormItem>
                        <FormItem label="硬件配置">
                        <Input v-model="PlayerFormItem.pguoji"  placeholder=""></Input>
                    </FormItem>
                     </FormItem>
                        <FormItem label="游戏简介">
                        <Input v-model="PlayerFormItem.pshuoming"  placeholder=""></Input>
                    </FormItem>
                    <FormItem>
                        <Button type="primary" @click="PlayerSubmit('PlayerFormItem')">添加完成</Button>
                    </FormItem>
                </Form>
            </Drawer>
            <!-- 展示游戏 -->
            <Drawer :closable="false" width="840" v-model="value5">
                <p>游戏信息</p>
                <Divider />
                    <content :style="{padding:'0 50px'}">
                    <Card>
                        <Table border :columns="columns4" :data="playerDate"   >
                            <template slot-scope="{ row }" slot="name">
                                <strong>{{ row.name }}</strong>
                            </template>
                            <template slot-scope="{ row, index }" slot="action">
                                <Button type="error" size="small" @click="playerRemove(row.pid)">删除</Button>
                            </template>
                        </Table>
                    </Card>    
                </content>
            </Drawer>
            <!-- 展示帖子专区 -->
            <Drawer :closable="false" width="540" v-model="value6">
                <p>展示帖子专区名称</p>
                <Divider />
                    <content :style="{padding:'0 50px'}">
                    <Card>
                        <Table border :columns="columns5" :data="zhuanquDate"   >
                            <template slot-scope="{ row }" slot="name">
                                <strong>{{ row.name }}</strong>
                            </template>
                            <template slot-scope="{ row, index }" slot="action">
                                <Button type="error" size="small" @click="zhuanquRemove(row.id)">删除</Button>
                                <Button type="primary" size="small" @click="tuijianzhuanqu(row.id)">推荐+1</Button>
                                <Button type="warning" size="small" @click="jiangjizhuanqu(row.id)">降级-1</Button>
                            </template>
                        </Table>
                    </Card>
                    <Form :model="zhuanquFormItem" :label-width="80">
                        <FormItem label="专区名称">
                            <Input v-model="zhuanquFormItem.zname" placeholder=""></Input>
                        </FormItem>
                         <FormItem label="排序号">
                            <Input v-model="zhuanquFormItem.indexnum" placeholder=""></Input>
                        </FormItem>
                      
                        <FormItem>
                            <Button type="primary" @click="zhuanquSubmit('zhuanquFormItem')">Submit</Button>
                        </FormItem>
                    </Form>
                </content>
            </Drawer>
            <!-- 展示违禁词信息 -->
             <Drawer :closable="false" width="740" v-model="value7">
                <p>展示违禁词信息</p>
                <Divider />
                    <content :style="{padding:'0 50px'}">
                    <Card>
                        <Table border :columns="columns6" :data="weijinciDate"   >
                            <template slot-scope="{ row }" slot="name">
                                <strong>{{ row.name }}</strong>
                            </template>
                            <template slot-scope="{ row, index }" slot="action">
                                <Button type="error" size="small" @click="weijinciRemove(row.id)">删除</Button>
                            </template>
                        </Table>
                    </Card>
                    <Form :model="weijinciFormItem" :label-width="80">
                        <FormItem label="添加违禁词">
                            <Input v-model="weijinciFormItem.wname" placeholder=""></Input>
                        </FormItem>
                      
                        <FormItem>
                            <Button type="primary" @click="winjinciSubmit('weijinciFormItem')">Submit</Button>
                        </FormItem>
                    </Form>
                </content>
            </Drawer>

            <!-- 展示违禁词帖子信息 -->
               <Drawer :closable="false" width="840" v-model="value8">
                <p>展示违禁帖子信息</p>
                <Divider />
                    <content :style="{padding:'0 50px'}">
                    <Card>
                        <Table border :columns="columns7" :data="weijintieDate"   >
                            <template slot-scope="{ row }" slot="name">
                                <strong>{{ row.name }}</strong>
                            </template>
                            <template slot-scope="{ row, index }" slot="action">
                                <Button type="error" size="small" @click="weijinciTieRemove(row.sid)">删除</Button>
                            </template>
                        </Table>
                    </Card>
                </content>
            </Drawer>
               
               

            <Footer class="layout-footer-center">2019-2020 &copy; TalkingData</Footer>
        </Layout>
    </div>
</template>

<script>
import axios from 'axios'

export default {
    name:"table-main",
    inject:["reload"],
    data(){
        return{
            tableDate:[],
            TeamDate:[],
            playerDate:[],
            zhuanquDate:[],
            weijinciDate:[],
            weijintieDate:[],
            columns2:[
                {key: 'id', title: '序号', width: 80, titleAlign: 'center', columnAlign: 'center',isResize:true},
                {key: 'createDatetime', title: '日期', width: 180, titleAlign: 'center', columnAlign: 'center',isResize:true},
                {key: 'username', title: '姓名', width: 180, titleAlign: 'center', columnAlign: 'center',isResize:true},
                {key: 'phone', title: '手机号码', width: 180, titleAlign: 'center', columnAlign: 'center',isResize:true},
                {key: 'email', title: '邮箱', width: 180, titleAlign: 'center', columnAlign: 'center',isResize:true},
                {key: 'zone', title: '地址', width: 280, titleAlign: 'center', columnAlign: 'center',isResize:true},
                {title: 'Action',slot: 'action', width: 150,align: 'center' }
            ],
            columns3:[
                 {key: 'tid', title: '序号', width: 80, titleAlign: 'center', columnAlign: 'center',isResize:true},
                {key: 'tname', title: '名称', width: 160, titleAlign: 'center', columnAlign: 'center',isResize:true},
                {key: 'tshuju', title: '成立时间', width: 160, titleAlign: 'center', columnAlign: 'center',isResize:true},
                {key: 'tzhanji', title: '总部', width: 160, titleAlign: 'center', columnAlign: 'center',isResize:true},
                {key: 'tjiaolian', title: '经典作品', width: 320, titleAlign: 'center', columnAlign: 'center',isResize:true},
                {key: 'tshuoming', title: '介绍', width: 960, titleAlign: 'center', columnAlign: 'center',isResize:true},
                {title: 'Action',slot: 'action', width: 150,align: 'center' }
            ],
            columns4:[
                {key: 'pid', title: '序号', width: 80, titleAlign: 'center', columnAlign: 'center',isResize:true},
                {key: 'pname', title: '名称', width: 160, titleAlign: 'center', columnAlign: 'center',isResize:true},
                {key: 'pweizhi', title: '价格', width: 80, titleAlign: 'center', columnAlign: 'center',isResize:true},
                {key: 'pshengao', title: '史低价格', width: 120, titleAlign: 'center', columnAlign: 'center',isResize:true},
                {key: 'ptizhong', title: '发布日期', width: 160, titleAlign: 'center', columnAlign: 'center',isResize:true},
                {key: 'pjingyan', title: '游戏类型', width: 320, titleAlign: 'center', columnAlign: 'center',isResize:true},
                {key: 'pguoji', title: '硬件配置', width: 480, titleAlign: 'center', columnAlign: 'center',isResize:true},
                {key: 'pshuoming', title: '游戏简介', width: 540, titleAlign: 'center', columnAlign: 'center',isResize:true},
                {title: 'Action',slot: 'action', width: 150,align: 'center' }
            ],
            columns5:[
                {key: 'id', title: '序号', width: 90, titleAlign: 'center', columnAlign: 'center',isResize:true},
                {key: 'zname', title: '专区名称', width: 100, titleAlign: 'center', columnAlign: 'center',isResize:true},
                {key: 'indexnum', title: '排序等级', width: 100, titleAlign: 'center', columnAlign: 'center',isResize:true},
                {title: 'Action',slot: 'action', width: 200,align: 'center' }
            ],
            columns6:[
                {key: 'id', title: '序号', width: 80, titleAlign: 'center', columnAlign: 'center',isResize:true},
                {key: 'wname', title: '违禁词', width: 180, titleAlign: 'center', columnAlign: 'center',isResize:true},
                {key: 'wdate', title: '生成时间', width: 180, titleAlign: 'center', columnAlign: 'center',isResize:true},
                {title: 'Action',slot: 'action', width: 200,align: 'center' }
            ],
            columns7:[
                 {key: 'sid', title: '序号', width: 80, titleAlign: 'center', columnAlign: 'center',isResize:true},
                {key: 'sname', title: '标题', width: 80, titleAlign: 'center', columnAlign: 'center',isResize:true},
                {key: 'sdate', title: '时间', width: 180, titleAlign: 'center', columnAlign: 'center',isResize:true},
                {key: 'scontext', title: '内容', width: 180, titleAlign: 'center', columnAlign: 'center',isResize:true},
                {key: 'szan', title: '点赞', width: 80, titleAlign: 'center', columnAlign: 'center',isResize:true},
                {key: 'sType', title: '类型', width: 80, titleAlign: 'center', columnAlign: 'center',isResize:true},
                {title: 'Action',slot: 'action', width: 150,align: 'center' }
            ],
            weijinciFormItem:{
                wname:''
            },
            TeamFormItem:{
                tname:'',
                tshuju:'',
                tzhanji:'',
                tjiaolian:'',
                tshuoming:''
            },
            PlayerFormItem:{
                pname:'',
                ptname:'',
                pweizhi:'',
                pshengao:'',
                ptizhong:'',
                pjingyan:'',
                pguoji:'',
                pshuoming:''
            },
            zhuanquFormItem:{
                zname:'',
                indexnum:''
            },
            value8:false,
            value7:false,
            value6: false,
            value5: false,
            value4: false,
            value3: false,
            value2:false,
            value1:false,
            styles: {
                height: 'calc(100% - 55px)',
                overflow: 'auto',
                paddingBottom: '53px',
                position: 'static'
            },
            formInline: {
                    password: ''
            },
            ruleInline: {
                password: [
                    { required: true, message: 'Please fill in the password.', trigger: 'blur' },
                    { type: 'string', min: 6, message: 'The password length cannot be less than 6 bits', trigger: 'blur' }
                ]
            },
            upTitleAreaResult:[],
            pStyle: {
                fontSize: '16px',
                color: 'rgba(0,0,0,0.85)',
                lineHeight: '24px',
                display: 'block',
                marginBottom: '16px'
            },
            TeamNum:0
        }
    },
    methods:{
        //删除违禁帖
        weijinciTieRemove(id){
             axios('http://localhost:8081/SportsDel?sId='+id).then((res) =>{
                    this.sportsNum = res.data;
                    if(this.sportsNum==1){
                        this.reload();
                        this.$Message.success('删除成功!');
                    }else{
                        this.$Message.success('删除失败!');
                    }
                  
                })
        },
        //展示违禁帖
        weijintieAll(){
              //在created函数中使用axios的get请求向后台获取用户信息数据
            axios('http://localhost:8081/weijinciTieFindAll').then(res=>{
                this.weijintieDate = res.data;
                this.value8 = true;
                console.log(this.weijintieDate);
            }).catch(function (error){
                console.log(error);
                
            });
        },
        //删除违禁词
           weijinciRemove(id){
              axios('http://localhost:8081/weijinciDel?id='+id).then((res) =>{
                if(res=1){
                    this.reload();
                    this.$Modal.confirm({
                        title: '成功',
                        loading: false
                    });
                }else{
                    this.$Message.error('表单验证失败!');
                }
            })
        },
          // 添加违禁词
        winjinciSubmit(weijinciFormItem){
            console.log(this.weijinciFormItem);
                let weijinci = JSON.stringify({
                    wname : this.weijinciFormItem.wname
                  
            });
            axios.post('http://localhost:8081/weijinciAdd', weijinci,{
                headers: {
                    "Content-Type": "application/json;charset=utf-8"  
                    }
                }) .then((res)=> {
                    this.TeamNum = res.data;
                    this.value7=false;
                if(this.TeamNum==1){
                    this.$Modal.confirm({
                        title: '添加成功！',
                        loading: false
                    });
                }else{
                    this.$Modal.confirm({
                        title: '创建失败！',
                        loading: false
                    });
                }
            }).catch(function(error) {
                console.log(error);
            });
        },
        // 展示违禁词
        weijinciAll(){
              //在created函数中使用axios的get请求向后台获取用户信息数据
            this.$ajax('http://localhost:8081/weijinciFindAll').then(res=>{
                this.weijinciDate = res.data;
                this.value7 = true;
                console.log(this.weijinciDate);
            }).catch(function (error){
                console.log(error);
                
            });
        },
        jiangjizhuanqu(id){
             axios('http://localhost:8081/jiangjizq?id='+id).then((res) =>{
                if(res=1){
                    this.reload();
                    this.$Modal.confirm({
                        title: '成功',
                        loading: false
                    });
                }else{
                    this.$Message.error('表单验证失败!');
                }
            })
        },
        tuijianzhuanqu(id){
              axios('http://localhost:8081/tuijianzq?id='+id).then((res) =>{
                if(res=1){
                    this.reload();
                    this.$Modal.confirm({
                        title: '成功',
                        loading: false
                    });
                }else{
                    this.$Message.error('表单验证失败!');
                }
            })
        },
        zhuanquRemove(id){
           
              axios('http://localhost:8081/zhuanquDel?id='+id).then((res) =>{
                if(res=1){
                    this.reload();
                    this.$Modal.confirm({
                        title: '成功',
                        loading: false
                    });
                }else{
                    this.$Message.error('表单验证失败!');
                }
            })
        },
        zhuanquSubmit(zhuanquFormItem){
            var zname = this.zhuanquFormItem.zname;
            var indexnum = this.zhuanquFormItem.indexnum;
              axios('http://localhost:8081/zhuanquAdd?indexnum='+indexnum+"&zname="+zname).then((res) =>{
                if(res=1){
                    this.reload();
                    this.$Modal.confirm({
                        title: '成功',
                        loading: false
                    });
                }else{
                    this.$Message.error('表单验证失败!');
                }
            })
        },
        tieziAll(){
            this.$ajax('http://localhost:8081/ZhuanQuFindAll').then(res=>{
                this.zhuanquDate = res.data;
                this.value6 = true;
                console.log(this.zhuanquDate);
            }).catch(function (error){
                console.log(error);
                
            });
        },
         SportsCircle(){
                this.$router.push({
                path: `/SportsCircle/` })
            },
            // MyTieZi(){
            //     this.$router.push({
            //     path: `/MyTieZi/` })
            // },
            // Team(){
            //     this.$router.push({
            //     path: `/Team/` })
            // },
            // TableMain(){
            //     this.$router.push({
            //     path: `/TableMain/` })
            // },
            adminOut(){
                sessionStorage.clear();
                this.$router.push({
                path: `/` })
            },
            // Home(){
            //     this.$router.push({
            //     path: `/Home/` })
            // },
        //修改密码
        handleSubmit(formInline) {
            this.upTitleAreaResult = this.formInline;
            var password = this.upTitleAreaResult.password;
            console.log(password);
            this.userId = sessionStorage.getItem('userId');
            axios('http://localhost:8081/personsUpdate?password='+password+'&id='+this.userId).then((res) =>{
                if(res=1){
                     this.$Message.success('修改成功，请重新登录!');
                        this.$router.replace('/');
                }else{
                        this.$Message.error('表单验证失败!');
                    }
            })
        },
        //展示账号
        findAll(){
            //在created函数中使用axios的get请求向后台获取用户信息数据
      
            this.$ajax('http://localhost:8081/findAll').then(res=>{
                this.tableDate = res.data;
                this.value4 = true;
                console.log(this.tableDate);
            }).catch(function (error){
                console.log(error);
                
            });
        },
        //删除账号
        personRemove(id){
            axios('http://localhost:8081/personsDel?id='+id).then((res) =>{
                if(res=1){
                    this.reload();
                    this.$Modal.confirm({
                        title: '删除成功！',
                        loading: false
                    });
                }else{
                    this.$Message.error('表单验证失败!');
                }
            })
        },
        // 添加公司
        TeamSubmit(TeamFormItem){
            console.log(this.TeamFormItem);
                let Team = JSON.stringify({
                    tname : this.TeamFormItem.tname,
                    tshuju : this.TeamFormItem.tshuju,
                    tzhanji : this.TeamFormItem.tzhanji,
                    tjiaolian : this.TeamFormItem.tjiaolian,
                    tshuoming :this.TeamFormItem.tshuoming
            });

            axios.post('http://localhost:8081/TeamAdd', Team,{
                headers: {
                    "Content-Type": "application/json;charset=utf-8"  
                    }
                }) .then((res)=> {
                    this.TeamNum = res.data;
                    this.value1=false;
                if(this.TeamNum==1){
                    this.$Modal.confirm({
                        title: '添加成功！',
                        loading: false
                    });
                }else{
                    this.$Modal.confirm({
                        title: '创建失败！',
                        loading: false
                    });
                }
            }).catch(function(error) {
                console.log(error);
            });
        },
        // 展示公司
        teamFindAll(){
              //在created函数中使用axios的get请求向后台获取用户信息数据
            this.$ajax('http://localhost:8081/TeamFindAll').then(res=>{
                this.TeamDate = res.data;
                this.value2 = true;
                console.log(this.TeamDate);
            }).catch(function (error){
                console.log(error);
                
            });
        },
        //删除公司
        teamRemove(id){
            axios('http://localhost:8081/TeamDel?tid='+id).then((res) =>{
                if(res=1){
                    this.reload();
                    this.$Modal.confirm({
                        title: '删除成功！',
                        loading: false
                    });
                }else{
                    this.$Message.error('表单验证失败!');
                }
            })
        },
        //打开抽屉后查询公司
        playerClick(){
            this.value3 = true;
            this.$ajax('http://localhost:8081/TeamFindAll').then(res=>{
                this.TeamDate = res.data;
                console.log(this.TeamDate);
            }).catch(function (error){
                console.log(error);
            });
        },
        //添加游戏
        PlayerSubmit(PlayerFormItem){
              console.log(this.PlayerFormItem);
                let player = JSON.stringify({
                    pname : this.PlayerFormItem.pname,
                    ptname : this.PlayerFormItem.ptname,
                    pweizhi : this.PlayerFormItem.pweizhi,
                    pshengao : this.PlayerFormItem.pshengao,
                    ptizhong :this.PlayerFormItem.ptizhong,
                    pjingyan :this.PlayerFormItem.pjingyan,
                    pguoji :this.PlayerFormItem.pguoji,
                    pshuoming :this.PlayerFormItem.pshuoming
            });

            axios.post('http://localhost:8081/playerAdd', player,{
                headers: {
                    "Content-Type": "application/json;charset=utf-8"  
                    }
                }) .then((res)=> {
                    this.TeamNum = res.data;
                    this.value3=false;
                if(this.TeamNum==1){
                    this.$Modal.confirm({
                        title: '添加成功！',
                        loading: false
                    });
                }else{
                    this.$Modal.confirm({
                        title: '创建失败！',
                        loading: false
                    });
                }
            }).catch(function(error) {
                console.log(error);
            });
        },
        //展示游戏
        playersClick(){
               //在created函数中使用axios的get请求向后台获取用户信息数据
            this.$ajax('http://localhost:8081/playerFindAll').then(res=>{
                this.playerDate = res.data;
                this.value5 = true;
                console.log(this.playerDate);
            }).catch(function (error){
                console.log(error);
                
            });
        },
        //删除游戏
        playerRemove(pid){
              axios('http://localhost:8081/playerDel?pid='+pid).then((res) =>{
                if(res=1){
                    this.reload();
                    this.$Modal.confirm({
                        title: '删除成功！',
                        loading: false
                    });
                }else{
                    this.$Message.error('表单验证失败!');
                }
            })
        }

    },
    //展示个人信息
    created(){
        //在created函数中使用axios的get请求向后台获取用户信息数据
              this.userId = sessionStorage.getItem('userId');
        this.$ajax('http://localhost:8081/idFindAll?id='+this.userId).then(res=>{
            this.tableDate = res.data
            console.log(this.tableDate);
        }).catch(function (error){
            console.log(error);
        });
    }
}
</script>
